home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / tests / Date.h next >
C/C++ Source or Header  |  1991-06-14  |  429b  |  21 lines

  1. #include <iostream.h>
  2. #include "RJS/NDR.h"
  3.  
  4. class Date : public XNDR {
  5.     friend ostream &operator<<(ostream &os, Date &dt) {
  6.         os << dt.m << "/" << dt.d << "/" << dt.y ;
  7.         return os;
  8.     }
  9. public:
  10.     Date() : y(0),m(0),d(0) {}
  11.     Date(int m1, int d1, int y1) : y(y1),m(m1),d(d1) {}
  12.     virtual void to_external(NDR_send &ndr) {
  13.         ndr << y << m << d;
  14.     }
  15.     virtual void to_internal(NDR_receive &ndr) {
  16.         ndr >> y >> m >> d;
  17.     }
  18.     int y,m,d;
  19.  
  20. };
  21.